<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        .wrap {
            position: fixed;
            width: 100%;
            height: 100%;
        }
    </style>
</head>
<body>
    <script>
        function createWaterMark() {
            const angle = -20;
            const txt = '笔记'
            const canvas = document.createElement('canvas');
            canvas.width = 180;
            canvas.height = 100;
            const ctx = canvas.getContext('2d');
            ctx.clearRect(0, 0, 180, 100);
            ctx.fillStyle = '#000';
            ctx.globalAlpha = 0.1;
            ctx.font = `16px serif`
            ctx.rotate(Math.PI / 180 * angle);
            ctx.fillText(txt, 0, 50);
            return canvas.toDataURL();
            }
            const watermakr = document.createElement('div');
            watermakr.className = 'wrap';
            watermakr.style.backgroundImage = `url(${createWaterMark()})`
            document.body.appendChild(watermakr);
    </script>
</body>
</html>